import ApplyInteractableObjectLocationMessageHandler from "@runtime/module/Handler/Base/ApplyInteractableObjectLocationMessageHandler";
import DeviceUpdateMessageHandler from "@runtime/module/Handler/Base/DeviceUpdateMessageHandler";
import InteractableObjectCheckedMessageHandler from "@runtime/module/Handler/Base/InteractableObjectCheckedMessageHandler";
import LabelUpdateMessageHandler from "@runtime/module/Handler/Base/LabelUpdateMessageHandler";
import LoadAllAssetProgressMessageHandler from "@runtime/module/Handler/Base/LoadAllAssetProgressMessageHandler";
import TooltipHideMessageHandler from "@runtime/module/Handler/Base/TooltipHideMessageHandler";
import TooltipShowMessageHandler from "@runtime/module/Handler/Base/TooltipShowMessageHandler";
import InertialNavigationCalibrationLabelUpdateMessageHandler from "@runtime/module/Handler/InertialNavigation/InertialNavigationCalibrationLabelUpdateMessageHandler";
import InertialNavigationProtocolDataUpdateMessageHandler from "@runtime/module/Handler/InertialNavigation/InertialNavigationProtocolDataUpdateMessageHandler";
import IntelligentConnectedVehicleInstallationCompleteMessageHandler from "@runtime/module/Handler/InertialNavigation/IntelligentConnectedVehicleInstallationCompleteMessageHandler";
import WebSocketComponent from "@runtime/module/WebSocket/WebSocketComponent";
import { ClientOpcode } from "../message/ClientOpcode";

export default class ClientMessageHandlerLoader {
    private static instance: ClientMessageHandlerLoader = new ClientMessageHandlerLoader();
    /**
     * 请求处理加载器
     */
    public static get Default(): ClientMessageHandlerLoader {
        return this.instance;
    }

    public Load(): void {
        WebSocketComponent.Default.Register(ClientOpcode.ApplyInteractableObjectLocationMessage, new ApplyInteractableObjectLocationMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.InteractableObjectCheckedMessage, new InteractableObjectCheckedMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.LabelUpdateMessage, new LabelUpdateMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.LoadAllAssetProgressMessage, new LoadAllAssetProgressMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.TooltipShowMessage, new TooltipShowMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.TooltipHideMessage, new TooltipHideMessageHandler());
        
        
        WebSocketComponent.Default.Register(ClientOpcode.DeviceUpdateMessage, new DeviceUpdateMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.InertialNavigationCalibrationLabelUpdateMessage, new InertialNavigationCalibrationLabelUpdateMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.InertialNavigationProtocolDataUpdateMessage, new InertialNavigationProtocolDataUpdateMessageHandler());
        WebSocketComponent.Default.Register(ClientOpcode.IntelligentConnectedVehicleInstallationCompleteMessage, new IntelligentConnectedVehicleInstallationCompleteMessageHandler());
    }
}